import React from 'react'
import styles from './index.less'
import { Row, Col,Button } from 'antd'
import {format} from '../../utils'
import driverLogo from '../../../assets/driverLogo.png'
import { config } from '../../utils'
const IMGURL = config.IMGURL
class detail extends React.Component {
    state = {
        ImgUrl:'',
        ImgUrlBon:false
    }
    render() {
    const {detail, onOk} =this.props
    const CashState =(e)=>{
        let text = ''
        switch(e){
            case 0:
                text = '提现失败'
                break;
            case 1:
                text = '提现成功'
                break;
            case 2:
                text = '提现处理中'
                break;          
        }
        return text
 
    }
    const onGetAut = ()=>{
        const data ={
            id:detail.id,
            state:1
        }
        onOk(data)
    }
    const onFaill =()=>{
        const data ={
            id:detail.id,
            state:0
        }
        onOk(data)
    }
    const Colstyle ={
        padding:'10px 0 10px 10px',
        boxSizing: 'border-box',
        margin:'0 20px',
    }
    const ColFont = {
        color:'#04021D',
        fontWeight: 'bold',
        paddingRight:5
    }
    return (
      <div>
        <div className={styles.filterTop}>
            <div className={styles.title}><span style={{marginRight:20}}>{detail.account }</span>
                <Button type="primary" style={{marginRight:20}} onClick={onGetAut} >
                    已打款
                </Button>
                <Button style={{marginRight:20}} onClick={onFaill} >
                    失败
                </Button>
            </div>
            <div className={styles.Searchright}>
            </div>
        </div>
        <div className={styles.listbox}>
            <Row>
                <Col span={20} style={Colstyle}><span style={ColFont}>账户:</span> {detail.account }</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>提现金额:</span> {detail.amount /100 }元</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>账号类型: </span>{detail.chargeType =='ali'?'支付宝':'微信' }</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>创建者: </span>{detail.createdBy }</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>创建时间:</span> { new Date(detail.createdDate).toLocaleString()}</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>提现申请人id: </span>{detail.customerId }</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>提现申请人姓名 :</span> { detail.customerName }</Col>
                <Col span={20} style={Colstyle}><span style={ColFont}>状态 : </span>{CashState(detail.state)}</Col>
            </Row>
        </div>
      </div>
    );
  }
}
export default detail
